<div class="box">
  
      <!--<ul>
        <?php foreach ($categories as $category) { ?>
        <li>
          <?php if ($category['category_id'] == $category_id) { ?>
          <a href="<?php echo $category['href']; ?>" class="active"><?php echo $category['name']; ?></a>
          <?php if ($category['children']) { ?>
          <ul>
            <?php foreach ($category['children'] as $child) { ?>
            <li>
              <?php if ($child['category_id'] == $child_id) { ?>
              <a href="<?php echo $child['href']; ?>" class="active"> - <?php echo $child['name']; ?></a>
              <?php } else { ?>
              <a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a>
              <?php } ?>
            </li>
            <?php } ?>
          </ul>
          <?php } ?>
          <?php } else { ?>
          <a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
          <?php } ?>
          
        </li>
        <?php } ?>
      </ul>--> 
      
      <!-------------------BEGIN MENU---------------------->
      
      <div class="item-nav active" id="big-daddy"> <!--<a class="viewall-item active" href="javascript:;"><span class="fs11">Danh mục</span> <br>
        <span>sản phẩm</span> <b>&nbsp;</b></a>-->
        <div class="sub-item-nav clearboth active" id="flyout">
          <div id="wrap-parent">
            <ul class="sub-level1 clearfix">
              <?php $i = 0; foreach($categories as $category) { ?>
              <li id="nav_cat_<?php echo $i; ?>" class="par_cat"><a href="<?php echo $category['href']; ?>"> <?php echo $category['name']; ?></a> <span class="nav-tag"><?php echo $category['description']; ?></span> </li>
              <?php $i++; } ?>
              <!--<li id="nav_cat_1" class="par_cat"><a href="http://www.1top.vn/c/thoi-trang-nam.html">Thời trang nam</a>
                         <span class="nav-tag">Sành điệu đón xuân</span>
                    </li>
                    <li id="nav_cat_2" class="par_cat"><a href="http://www.1top.vn/c/thoi-trang-nu.html"> Thời trang nữ</a>
                        <span class="nav-tag">Đẹp - Sành điệu - Hợp thời trang</span>
                    </li>
                    <li id="nav_cat_6" class="par_cat"><a href="http://www.1top.vn/c/cong-nghe-dien-thoai.html">Công nghệ - Điện thoại</a>
                         <span class="nav-tag">Điện thoại, máy tính bảng, phụ kiện</span>
                    </li>
                    <li id="nav_cat_4" class="par_cat"><a href="http://www.1top.vn/c/do-gia-dung.html">Đồ gia dụng</a>
                         <span class="nav-tag">Thêm tiện nghi cho gia đình bạn</span>
                    </li>
                    <li class="pd-bt par_cat" id="nav_cat_5"><a href="http://www.1top.vn/c/my-pham-lam-dep.html">Mỹ phẩm - Làm đẹp</a></li>
                    <li id="nav_cat_8" class="par_cat"><a href="http://www.1top.vn/c/do-doi-do-du-lich.html">Đồ đôi - Đồ du lịch</a></li>
                    <li id="nav_cat_3" class="par_cat"><a href="http://www.1top.vn/c/me-va-be.html">Mẹ và bé</a></li>
                    <li id="nav_cat_7" class="par_cat"><a href="http://www.1top.vn/c/goc-gia-dinh.html">Góc gia đình</a></li>
                    <li id="nav_cat_9" class="par_cat"><a href="http://www.1top.vn/c/khuyen-mai-khac.html">Khuyến mại khác</a></li>-->
            </ul>
          </div>
          <div id="wrap-child" style="display: block; overflow: visible;">
            <?php $i = -1; foreach($categories as $category) { $i++; ?>
            <?php if ($category['children']) { ?>
            <div class="wrap-sub sub_active" id="sub_cat_<?php echo $i; ?>">
              <ul class="sub-level2" style="display: none;">
              <?php if($category['image']) { ?>
                <img style="position:absolute;max-width:525px;max-height:281px;display:block;bottom:0;right:0" alt="<?php echo $category['name']; ?>" src="<?php echo $category['image']; ?>">
                <?php } ?>
                <li>
                  <div class="sub-level2-item">
                    <h2><?php echo $category['name']; ?></h2>
                    <ul>
                      <?php foreach($category['children'] as $child) { ?>
                      <li> <a href="<?php echo $child['href'];?>"><?php echo $child['name']; ?></a> </li>
                      <?php } ?>
                    </ul>
                  </div>
                  <!--
                            <div style="margin-top:15px" class="sub-level2-item sub-level2-nobd">
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/hang-hieu-that-lung.html">Thắt lưng</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/hang-hieu-vi.html">Ví(Bóp)</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/hang-hieu-kinh-mat.html">Kính mắt</a>
                                    </li>
                                </ul>
                            </div>--> 
                </li>
              </ul>
            </div>
            <?php  }} ?>
            <!--<div class="wrap-sub sub_active" id="sub_cat_1">
                    <ul class="sub-level2" style="display: none;">
                        <img style="position:absolute;width:442px;height:265px;display:block;bottom:0;right:0" alt="Thời trang" src="./index_files/bgFashion.png">
                        <li>
                            <div class="sub-level2-item">
                                <h2>Thời trang nam</h2>
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nam-quan-ao.html">Quần Áo</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nam-dong-ho.html">Đồng hồ</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nam-giay-dep.html">Giày dép</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nam-do-lot.html">Đồ lót</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nam-do-the-thao.html">Đồ thể thao</a>
                                    </li>
                                    
                                </ul>
                            </div>
                            <div style="margin-top:15px" class="sub-level2-item sub-level2-nobd">
                                <ul>
                               
    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nam-that-lung-day-nit.html">Thắt lưng (dây nịt)</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nam-kinh-mat.html">Kính mắt</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nam-vi-bop-tui-xach.html">Ví (bóp), Túi xách</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nam-khac.html">Khác</a>
                                    </li>
                                    
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="wrap-sub sub_active" id="sub_cat_2">
                    <ul class="sub-level2" style="display: none;">
                        <img style="position:absolute;width:525px;height:281px;bottom:0;right:0" alt="" src="./index_files/bgWomenFashion.png">
                        <li>
                            <div class="sub-level2-item">
                                <h2>Thời trang nữ</h2>
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nu-quan-ao.html">Quần áo</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/vay-dam.html">Váy, đầm</a>
                                    </li>
                                    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nu-do-lot.html">Đồ lót</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nu-do-ngu-mac-nha.html">Đồ ngủ, mặc nhà</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nu-do-the-thao.html">Đồ thể thao</a>
                                    </li>    
                                </ul>
                            </div>
                            <div style="margin-top:15px" class="sub-level2-item sub-level2-nobd">
                                <ul>
                                
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nu-dong-ho.html">Đồng hồ</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nu-giay-dep.html">Giày dép</a>
                                    </li>
                                    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nu-vi-bop-tui-xach.html">Ví (bóp), túi xách</a>
                                    </li>
                                    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nu-kinh-mat.html">Kính mắt</a>
                                    </li>

                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nu-trang-suc.html">Trang sức</a>
                                    </li>
                                    
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nu-that-lung.html">Thắt lưng (dây nịt)</a>
                                    </li>
                                  
                                    
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="wrap-sub sub_active" id="sub_cat_3">
                    <ul class="sub-level2" style="display: none;">
                        <img style="position:absolute;width:523px;height:241px;bottom:0;right:0" alt="" src="./index_files/bgBaby.png">
                        <li>
                            <div class="sub-level2-item">
                                <h2>Mẹ và bé</h2>
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/vay-bau.html">Thời trang cho mẹ</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/do-cho-me.html">Đồ cho mẹ</a>
                                    </li>
                                     <li>
                                        <a href="http://www.1top.vn/c/me-va-be-thuc-pham-dinh-duong.html">Thực phẩm dinh dưỡng</a>
                                    </li>
                                    
                                </ul>
                            </div>
                            <div style="margin-top:15px" class="sub-level2-item sub-level2-nobd">
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-cho-be.html">Quần áo cho bé</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/do-dung-cho-tre.html">Đồ dùng cho trẻ</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/do-choi.html">Đồ chơi</a>
                                    </li>
                                    
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="wrap-sub sub_active" id="sub_cat_4">
                    <ul class="sub-level2" style="display: none;">
                        <img style="position:absolute;width:437px;height:210px;bottom:0;right:0" alt="" src="./index_files/bgGiadung.png">
                        <li>
                            <div class="sub-level2-item">
                                <h2>Đồ gia dụng</h2>
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/do-gia-dung-nha-bep.html">Đồ gia dụng nhà bếp</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/thiet-bi-cham-soc-quan-ao.html">Thiết bị chăm sóc quần áo</a>
                                    </li>

                                </ul>
                            </div>
                            <div style="margin-top:15px" class="sub-level2-item sub-level2-nobd">
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/thiet-bi-gia-dinh.html">Thiết bị gia đình</a>
                                    </li>
    
                                    <li>
                                        <a href="http://www.1top.vn/c/quat-may-do-tien-ich.html">Quạt máy, đồ tiện ích</a>
                                    </li>

                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="wrap-sub sub_active" id="sub_cat_5">
                    <ul class="sub-level2" style="display: none;">
                        <img style="position:absolute;width:496px;height:261px;bottom:0;right:-27px" alt="" src="./index_files/bgMypham.png">
                        <li>
                            <div class="sub-level2-item">
                                <h2>Mỹ phẩm - Làm đẹp</h2>
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/my-pham-cham-soc-da.html">Mỹ phẩm chăm sóc da</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/My-pham-cham-soc-toc.html">Mỹ phẩm chăm sóc tóc</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/My-pham-trang-diem.html">Mỹ phẩm trang điểm</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/nuoc-hoa-nam.html">Nước hoa nam</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/nuoc-hoa-nu.html">Nước hoa nữ</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/thiet-bi-cham-soc-suc-khoe.html">Thiết bị chăm sóc sức khỏe</a>
                                    </li>
                                    
                                </ul>
                            </div>
                            <div style="margin-top:15px" class="sub-level2-item sub-level2-nobd">
                                <ul>
                                    
                                    <li>
                                        <a href="http://www.1top.vn/c/my-pham-lam-dep-dung-cu-cham-soc-toc.html">Dụng cụ chăm sóc tóc</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/dung-cu-trang-diem.html">Dụng cụ trang điểm</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/dung-cu-massage.html">Dụng cụ massage</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/dung-cu-the-thao.html">Dụng cụ thể thao</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/my-pham-khac.html">Mỹ phẩm khác</a>
                                    </li>
                                    
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
                
                <div class="wrap-sub sub_active" id="sub_cat_6">
                    <ul class="sub-level2" style="display: none;">
                        <img style="position:absolute;width:442px;height:245px;bottom:0;right:0" alt="" src="./index_files/bgTechlo.png">
                        <li>
                            <div class="sub-level2-item">
                                <h2>Công nghệ - Điện thoại</h2>
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/may-tinh-bang-laptop.html">Máy tính bảng - Laptop</a>
                                    </li>
    
                                    <li>        
                                        <a href="http://www.1top.vn/c/may-nghe-nhac.html">Máy nghe nhạc</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/may-anh-may-quay.html">Máy ảnh, máy quay</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/tai-nghe-loa.html">Tai nghe - Loa</a>
                                    </li>
                                </ul>
                            </div>
                            <div style="margin-top:15px" class="sub-level2-item sub-level2-nobd">
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/dien-thoai.html">Điện thoại</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/chuot-ban-phim.html">Chuột - Bàn phím</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/usb-the-nho.html">USB - Thẻ nhớ</a>
                                    </li>
                                    
                                    <li>
                                        <a href="http://www.1top.vn/c/Phu-kien.html">Phụ kiện</a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="wrap-sub sub_active" id="sub_cat_7">
                    <ul class="sub-level2" style="display: none;">
                        <img style="position:absolute;width:503px;height:275px;bottom:0;right:0" alt="" src="./index_files/Gocgiadinh.png">
                        <li>
                            <div class="sub-level2-item">
                                <h2>Góc gia đình</h2>
                                <ul>
                                    <li><a href="http://www.1top.vn/c/do-dung-phong-ngu.html">Đồ dùng phòng ngủ</a></li>
                                    <li><a href="http://www.1top.vn/c/do-dung-phong-tam.html">Đồ dùng phòng tắm</a></li>
                                    <li><a href="http://www.1top.vn/c/do-dung-phong-khach.html">Đồ dùng phòng khách</a></li>
                                    
                                </ul>
                            </div>
                            <div style="margin-top:15px" class="sub-level2-item sub-level2-nobd">
                                <ul>
                                    <li><a href="http://www.1top.vn/c/do-dung-van-phong.html">Đồ dùng văn phòng</a></li>
                                    <li><a href="http://www.1top.vn/c/trang-tri-nha-cua.html">Trang trí nhà cửa</a></li>
                                   <!-- <li><a href="http://www.1top.vn/c/do-noi-ngoai-that-khac.html">Đồ nội ngoại thất khác</a></li> 
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
                
                <div class="wrap-sub sub_active" id="sub_cat_8">
                    <ul class="sub-level2" style="display: none;">
                        <img style="position:absolute;width:511px;height:236px;bottom:0;right:0" alt="" src="./index_files/dodulich.png">
                        <li>
                            <div class="sub-level2-item">
                                <h2>Đồ đôi - Đồ du lịch</h2>
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/quan-ao-doi.html">Quần áo đôi</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/Nhan-doi.html">Nhẫn đôi</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/do-boi-doi.html">Đồ bơi đôi</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/do-doi-khac.html">Khác</a>
                                    </li>
                                </ul>
                            </div>
                            <div style="margin-top:15px" class="sub-level2-item sub-level2-nobd">
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/thoi-trang-nu-ao-tam-do-boi.html">Áo tắm, đồ bơi</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/kem-chong-nang.html">Kem chống nắng</a>
                                    </li>
                                    <li>
                                        <a href="http://www.1top.vn/c/phu-kien-du-lich.html">Phụ kiện du lịch</a>
                                    </li>
                                 </ul>
                            </div>
                        </li>
                    </ul>
                </div>     --> 
            <!--
                <div class="wrap-sub" id="sub_cat_9">
                    <ul  class="sub-level2">
                        <img style="position:absolute;width:558px;height:272px;bottom:0;right:-42px" alt="" src="http://www.1top.vn/webskins/skins/frontend/bg_category/hangtet.png"/>
                        <li>
                            <div class="sub-level2-item">
                                <h2>Khuyến mại khác</h2>
                                <ul>
                                     <li>
                                        <a href="http://www.1top.vn/c/hang-tet.html">Hàng tết</a>
                                    </li>
                                </ul>
                            </div>
                            <div style="margin-top:15px" class="sub-level2-item sub-level2-nobd">
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/qua-bieu.html">Quà biếu</a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="wrap-sub sub_active" id="sub_cat_9">
                    <ul class="sub-level2" style="display: block;">
                        <img style="position:absolute;width:509px;height:252px;bottom:0;right:0" alt="" src="./index_files/Quatangkhac.png">
                        <li>
                            <div class="sub-level2-item">
                                <h2>Khuyến mại khác</h2>
                                <ul>
                                    <li>
                                        <a href="http://www.1top.vn/c/dich-vu-lam-dep.html">Dịch vụ làm đẹp - Sức khỏe</a>
                                    </li>
                                     
                                </ul>
                            </div>
                            <a href="http://www.1top.vn/c/qua-tang.html">Quà tặng</a>
<div style="margin-top:15px" class="sub-level2-item sub-level2-nobd"> </div>
                        </li>
                    </ul>
                </div>
                
            </div>
            <!--end hang hieu--> 
          </div>
        </div>
        
        <!--------------------END MENU----------------------> 
        
      </div>
    </div>

